Closed
Bug 1962439
Opened 1 month ago
Closed 1 month ago
contenteditable=plaintext-only inserts <br>
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: steiner.thomas, Unassigned)
References
()
Details
Attachments
(1 file)
380.84 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Steps to reproduce:
- Go to https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/contenteditable
- Enter text with line breaks
- Note how the element contains <br>
Actual results:
There should not be <br>
Expected results:
There should be a regular \n
![]() |
||
Updated•1 month ago
|
Component: Untriaged → DOM: Editor
Product: Firefox → Core
Comment 1•1 month ago
|
||
The white-space
value is normal
. Therefore, \n
should be treated as a collapsible white-space. So, <br>
is required for a line break. I think that you expect the hack of Chromium which overrides white-space
style forcibly. That's illegal behavior.
Status: UNCONFIRMED → RESOLVED
Closed: 1 month ago
Resolution: --- → INVALID
Comment 2•1 month ago
|
||
So, if you want both Firefox and Safari work as Chrome, specifying white-space: pre-wrap
.
Updated•1 month ago
|
Updated•1 month ago
|
See Also: → https://issues.chromium.org/issues/413427424
Reporter | ||
Comment 3•1 month ago
|
||
Oh, thanks for the pointer to https://crbug.com/413427424. I have changed the component of this bug to be (hopefully) more adequate.
Updated•1 month ago
|
See Also: → https://github.com/mdn/content/issues/39347
You need to log in
before you can comment on or make changes to this bug.
Description
•